<template>
	<view class="content">
		<view class="card" v-for="(item,index) in list" :key="index" @click="clickItem(item)">
			<view class="card_l">
				<u-image width="285rpx" height="240rpx" mode="aspectFill"
					:src="getImage(item.prIoc)"></u-image>
			</view>	
			<view class="card_r">
				<view class="card_r_t">
					{{item.prModel}}
				</view>
				<view class="card_r_r">
					￥{{item.prPrice}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getPpxh} from "@/common/api.js"
	import {url} from "@/common/index.js"
	export default {
		data() {
			return {
				list:[]
			}
		},
		onLoad(data) {
			getPpxh({prBrand:data.item,prType:data.code}).then(res=>{
				this.list = res.rows
			})
		},
		methods:{
			clickItem(item){
				uni.navigateTo({
					url:"/pagesShop/details/details?item="+item.id
				})
			},
			getImage(path){
				return url + path
			}
		}
	}
</script>

<style lang='scss'>
	page{
		background-color: #222;
	}
	.content {
		padding: 15rpx;
		display: flex;
		flex-wrap: wrap;
	}

	.card {
		width: 48%;
		height: 35% ;
		padding: 30rpx;
		margin: 2px;
		border-radius: 15rpx;
		border-style: 1rpx;
		margin-bottom: 20rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		border: 2rpx solid #6a6a6a;
	}
	.card_l{
		margin-right: 15rpx;
		padding: 2rpx;
	}
	.card_r_t{
		color: #fff;
		margin: 10rpx;
	}
	.card_r_r{
		color: #ff7834;
	}
</style>